package com.bloomfiler.demo.config;

import org.redisson.api.RBloomFilter;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

@Configuration
public class RedissBloomFilerConfig {
    @Autowired
    RedissonClient redissonClient;

    @Bean
    public RBloomFilter<String>  bloomFilter(){
        RBloomFilter<String> bloomFilter =redissonClient.getBloomFilter("bloomtest");
        bloomFilter.tryInit((long) 1E8,0.003);

        return bloomFilter;
    }
}
